import { Command } from 'commander'
import { version } from '../package.json'
import { create } from './command/create'
import { update } from './command/update'; // 确保路径正确

const program = new Command('hans')

program.version(version, '-v, --version')

program.command('update').description('update cli').action(async (dirName) => {
    await update(dirName)
})

program
    .command('create')
    .description('create a new project')
    .argument('[name]', 'project name')
    .action(async (dirName) => {
        create(dirName)
        // if (dirName) {
            
        // } else {
        //     console.log('no project name')
        // }
    })

program.parse();